import axios from './http.js'
// 获取姓名
export function getUserName () {
  const url = '/session/getUserName'

  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}

export function logOut () {
  const url = '/session/remove'
  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}
export function getSysVersion () {
  const url = '/detail/getSysVersion'
  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}
export function getUserLogs () {
  const url = '/detail/getUserLogs'
  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}
// 获取版本号用于缓存
export function getVersionNum () {
  const url = '/detail/getVersionNum'
  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}
// 判断是否可以编辑
export function getNavRoleMenu () {
  const url = '/session/getNavRoleMenu'
  return axios.get(url).then(res => {
    return Promise.resolve(res.data)
  })
}
// post请求
export function postData (url, params) {
  return axios.post(url, params).then(res => {
    return Promise.resolve(res.data)
  })
}
// get请求
export function getData (url, params) {
  return axios.get(url, {params: params}).then(res => {
    return Promise.resolve(res.data)
  })
}
